package com.ciwong.epaper.modules.pad.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.pad.contentprovider.LoginToken;


/**
 * Created by Administrator on 2017/7/12.
 */
public class PadExitActivity extends Activity implements View.OnClickListener{



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_pad_exit_dialog);
        setFinishOnTouchOutside(true);
        findViewById(R.id.btn_confirm).setOnClickListener(this);
        findViewById(R.id.btn_cancel).setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        int id = v.getId();
        if(id ==R.id.btn_confirm){
            LoginToken.cleanLocalToken(getContentResolver());
            Intent intent = new Intent(LoginToken.ACTION_EXIT_LOGIN);
            sendBroadcast(intent);
            setResult(RESULT_OK);
            finish();
        }else if(id ==R.id.btn_cancel ){
            finish();
        }
    }

}
